-
Notifications
You must be signed in to change notification settings - Fork 13
Update SparkFun_Qwiic_Humidity_AHT20.cpp #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Initialization data byte (MSB) was flipped, not matching AHT20 datasheet.
Was something failing? |
Yes. Tested on six AHT20s across three MCUs. Multiple sensors would either
return zeros, correct data, or incorrect data (randomly) until the nibbles
were flipped. Platform is ESP32-S2.
Best,
Jake
…On Sun, Aug 29, 2021 at 3:24 PM Nathan Seidle ***@***.***> wrote:
Was something failing?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOD7JU7EKIXVYIHFTRUBVB3T7KJO7ANCNFSM5DALPHLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Got it thanks! I'll get it tested shortly. |
What datasheet are you looking at? My reference. Original code is correct per datasheet. I've tested both main branch and your PR and both work. I am far more suspicious of the ESP32-S2 at this point. This library doesn't use repeated starts but I'm still not convinced the ESP32-S2 core is completely sound. If it works for you, excellent. But I can't replicate and I believe we're following the datasheet so I'm going to pass for now. Regardless, I really appreciate the PR. Let me know if the plot thickens. |
I'm looking at the same datasheet. I read the datasheet as: initialization
requires three bytes to be written in sequence, {0xBE, 0x08, 0x00}. Maybe
I'm not using git correctly, but when I view the current source code at
https://github.com/sparkfun/SparkFun_Qwiic_Humidity_AHT20_Arduino_Library/blob/main/src/SparkFun_Qwiic_Humidity_AHT20.cpp,
the sequence is {0xBE, 0x80, 0x00} as seen in Lines 123-125. The PR is to
change the second byte, 0x80, to 0x08 on Line 124.
…On Thu, Oct 14, 2021 at 4:22 PM Nathan Seidle ***@***.***> wrote:
What datasheet are you looking at? My reference
<https://cdn.sparkfun.com/assets/d/2/b/e/d/AHT20.pdf>.
[image: image]
<https://user-images.githubusercontent.com/117102/137396882-abf81dc5-b2f5-4045-939a-cf2827b38744.png>
Original code is correct per datasheet. I've tested both main branch and
your PR and both work. I am far more suspicious of the ESP32-S2
<sparkfun/SparkFun_MLX90640_Arduino_Example#24>
at this point. This library doesn't use repeated starts but I'm still not
convinced the ESP32-S2 core is completely sound.
If it works for you, excellent. But I can't replicate and I believe we're
following the datasheet so I'm going to pass for now. Regardless, I really
appreciate the PR. Let me know if the plot thickens.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOD7JU76V5MWFVCNPK5ZB4TUG5CZXANCNFSM5DALPHLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Current code is here: Above, current main branch code, follows datasheet: 0xBE, 0x08, 0x00. |
GAHHH! Wow. Brains see what they want to see. Sorry. You said nibbles and I read bytes. Yep. Thanks for taking the time. |
Haha, no worries. I don't have the greatest eyesight, myself. Glad it is
taken care of and will keep your note about the repeated start in mind.
…On Fri, Oct 15, 2021, 10:14 AM Nathan Seidle ***@***.***> wrote:
Merged #4
<#4>
into main.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOD7JU3GFNJH6HW4NRNWJLLUHBANZANCNFSM5DALPHLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Nibbles in initialization data byte (MSB) were flipped, not matching AHT20 datasheet.